home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Resources / PaperCut Quota 6.1 / pc-setup.exe / {app} / WebAdmin / Logon.asp < prev    next >
Text File  |  2005-07-05  |  2KB  |  63 lines

  1. <%@ Language=VBScript %>
  2. <%' (c) Copyright 1999-2004 PaperCut Software Pty. Ltd. %>
  3. <!-- #include file="includes/PCCommon.inc" -->
  4. <!--#include file="includes/header.inc" -->
  5.  
  6. <h1><%=GetText("Login")%></h1>
  7.  
  8. <%
  9.     If Not gblnAllowAnonymousAccess Then
  10.         WriteErrorMessage GetText("AnonAccessDisabled")
  11.         Response.End
  12.     End If
  13.  
  14.     Dim strUsername
  15.     strUsername = Trim(Request("strUsername"))
  16.     If strUsername <> "" Then
  17.         strUsername = Trim(Request("strUsername"))
  18.         Session("AnonUsername") = ""
  19.  
  20.         ' Check that it's a valid user
  21.         Dim objPCWeb
  22.         Set objPCWeb = Server.CreateObject("PCWebAdmin.PCWebUsers")
  23.         If objPCWeb.Error Then
  24.             WriteErrorMessage objPCWeb.ErrorDescription
  25.         Else
  26.             objPCWeb.SeekUser(strUsername)
  27.  
  28.             If (UCase(objPCWeb.UserName) <> UCase(strUsername)) Then
  29.                 ' Can't find the user
  30.                 WriteErrorMessage GetTextReplace("ErrorCantFindUser", Array(strUsername))
  31.             Else
  32.                 ' Valid user, so log them in
  33.                 Session("AnonUsername") = strUsername
  34.  
  35.                 ' Send them back to the default page
  36.                 Response.Redirect "default.asp"
  37.             End If
  38.         End If
  39.  
  40.         Set objPCWeb = Nothing
  41.  
  42.     End If
  43. %>
  44.  
  45.  
  46. <p><%=GetText("LoginInstructions")%></p>
  47.  
  48. <FORM ACTION="Logon.asp" METHOD="POST">
  49. <INPUT type="hidden" name=blnSubmitted value="T">
  50.   <TABLE class="webAdmin" width="500">
  51.     <TR class="evenRow" >
  52.       <TH width="150"><%=GetText("Username")%>:</TH>
  53.       <TD width="250"><input type="text" name="strUserName" value="<%= strUsername%>"></TD>
  54.     </TR>
  55.     <TR>
  56.         <TD align="right" colspan="2">
  57.             <INPUT type="submit" value="<%=GetText("Login")%>" name="cmdLogin">
  58.         </TD>
  59.     </TR>
  60. </TABLE>
  61. </FORM>
  62.  
  63. <!--#include file="includes/footer.inc" -->